func reverseStr(s string, k int) string {
    strlist := []byte(s)

    for i := 0; i < len(s); i += 2*k {
        rightEdg := 0
        if i + k <= len(s) {
            rightEdg = i + k
        } else {
            rightEdg = len(s)
        }
        reverse(strlist[i:rightEdg])
    }

    return string(strlist)
}

func reverse(strlist []byte) {
    l, r := 0, len(strlist) - 1
    for l < r {
        strlist[l], strlist[r] = strlist[r], strlist[l]
        l++
        r--
    }
}